package cn.trda.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.trda.mapper.AsSystemconfigMapper;
import cn.trda.pojo.Systemconfig;
import cn.trda.service.SystemConfigService;
import cn.trda.util.MySqlPageUtil;
@Service
public class SystemConfigServiceImpl implements SystemConfigService {
	@Autowired
	private AsSystemconfigMapper asSystemconfigMapper;

	@Override
	public Systemconfig selectByPrimaryKey(Long id) {
		// TODO Auto-generated method stub
		return asSystemconfigMapper.selectByPrimaryKey(id);
	}
	@Override
	public List<Systemconfig> selectByConfigType(Integer configType) {
		// TODO Auto-generated method stub
		return asSystemconfigMapper.selectByConfigType(configType);
	}

	@Override
	public List<Systemconfig> getSystemConfigByConfigType(
			Systemconfig systemconfig) {
		// TODO Auto-generated method stub
		return asSystemconfigMapper.getSystemConfigByConfigType(systemconfig);
	}

	
	@Override
	public Integer selectMaxTypeValueByConfigType(Systemconfig systemConfig)
			throws Exception {
		return asSystemconfigMapper.selectMaxTypeValueByConfigType(systemConfig);
	}
	
	@Override
	public int addSystemConfig(Systemconfig systemConfig) throws Exception {
		Integer max = asSystemconfigMapper.selectMaxTypeValueByConfigType(systemConfig);
		systemConfig.setConfigtypevalue(++max);
		return asSystemconfigMapper.addSystemConfig(systemConfig);
	}
	
	@Override
	public Integer deleteSystemConfigById(Systemconfig systemConfig)
			throws Exception {
		// TODO Auto-generated method stub
		return asSystemconfigMapper.deleteSystemConfigById(systemConfig);
	}
	
	@Override
	public Systemconfig getSystemConfigById(Long id) throws Exception {
		// TODO Auto-generated method stub
		return asSystemconfigMapper.getSystemConfigById(id);
	}
	
	@Override
	public int updateSystemConfig(Systemconfig systemconfig) throws Exception {
		// TODO Auto-generated method stub
		return asSystemconfigMapper.updateSystemConfig(systemconfig);
	}



	@Override
	public Integer getCount(Integer configtype) throws Exception {
		// TODO Auto-generated method stub
		return asSystemconfigMapper.getCount(configtype);
	}



	@Override
	public List<Systemconfig> getSystemConfigByPage(Systemconfig systemConfig,
			MySqlPageUtil pt) throws Exception {
		// TODO Auto-generated method stub
		return asSystemconfigMapper.getSystemConfigByPage(systemConfig, pt);
	}
	
	
	
	
	
	
}
